package hsw.socialmedia.model.dao.rowMapper;

import hsw.socialmedia.model.entity.Message;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class MessageRowMapper {
	
	private final Log logger = LogFactory.getLog(MessageRowMapper.class);

	public Message mapRow(ResultSet rs) throws SQLException {
		logger.debug("entering messageRowMapper");

		Message result = new Message();
		result.setMessageID(rs.getInt("messageID"));
		result.setSenderID(rs.getInt("senderID"));
		result.setReceiverID(rs.getInt("receiverID"));
//		result.setPicture(rs.getBlob("bild"));
		result.setText(rs.getString("text"));
		result.setOrt(rs.getString("ort"));
		return result;
	}
}
